<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'page-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><?php echo Yii::t('back',
				'Fields with {asterisk} are required.',
				array('{asterisk}'=>'<span class="required">*</span>'));
	?></p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>
	
	<div class="row oneLineLabel">
        <?php echo $form->labelEx($model, 'nodes.name'); ?>
        <?php echo $form->dropDownList($model, 'nodes',
            CHtml::listData(Node::model()->findAll(), 'id', 'name'),
            	array(
            		'empty'=>Yii::t('back', ' - no content - '),
            	)
            ); ?>
        <?php echo $form->error($model, 'nodes'); ?>
    </div>

	<div class="row">
		<?php echo $form->labelEx($model,'position'); ?>
		<?php echo $form->textField($model,'position'); ?>
		<?php echo $form->error($model,'position'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'parent_id'); ?>
		<?php echo $form->dropDownList($model,'parent_id',
			CHtml::listData(Page::model()->findAll('id<>:id', array(':id'=>$model->id)), 'id', 'name'),
				array(
					'empty'=>Yii::t('back', ' - no parent - ')
				)
			); ?>
		<?php echo $form->error($model,'parent_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'in_navigation'); ?>
		<?php echo $form->checkBox($model,'in_navigation'); ?>
		<?php echo $form->error($model,'in_navigation'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'layout_id'); ?>
		<?php echo $form->dropDownList($model,'layout_id',
			CHtml::listData(Layout::model()->findAll(), 'id', 'name')); ?>
		<?php echo $form->error($model,'layout_id'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('back', 'Create') : Yii::t('back', 'Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->